package com.huazh.controller;

import com.huazh.bean.Account;
import com.huazh.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:
 * @Authoe: hzh
 * @Time: 2020/7/2817:24
 */
@RequestMapping("/account")
@RestController
public class AccountController {

    @Autowired
    private AccountService accountService;

    @GetMapping("/get/{id}")
    public Account success(@PathVariable("id") Long id){
        return accountService.queryById(id);
    }

    @GetMapping("/add/{userName}")
    public Account add(@PathVariable("userName") String userName){
        return accountService.add(userName);
    }

}
